<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.global.js"></script>
    <style>
        .demo {
            font-family: sans-serif;
            border: 1px solid #eee;
            border-radius: 2px;
            padding: 20px 30px;
            margin-top: 1em;
            margin-bottom: 40px;
            user-select: none;
            overflow-x: auto;
        }
    </style>
</head>

<body>
    <div id="v-model-textarea" class="demo">
        <span>Multiline message is:</span>
        <p style="white-space: pre-line;">{{ message }}</p>
        <br />
        <textarea v-model="message" placeholder="add multiple lines"></textarea>

        <hr>

        <div id="v-model-checkbox" class="demo">
            <input type="checkbox" id="checkbox" v-model="checked" />
            <label for="checkbox">{{ checked }}</label>
        </div>

        <hr>

        <div id="v-model-multiple-checkboxes">
            <input type="checkbox" id="jack" value="Jack" v-model="checkedNames" />
            <label for="jack">Jack</label>
            <input type="checkbox" id="john" value="John" v-model="checkedNames" />
            <label for="john">John</label>
            <input type="checkbox" id="mike" value="Mike" v-model="checkedNames" />
            <label for="mike">Mike</label>
            <br />
            <span>Checked names: {{ checkedNames }}</span>
        </div>

        <hr>

        <div id="v-model-radiobutton">
            <input type="radio" id="one" value="男" v-model="gender" />
            <label for="one">男</label>
            <br />
            <input type="radio" id="two" value="女" v-model="gender" />
            <label for="two">女</label>
            <br />
            <input type="radio" id="three" value="死变态" v-model="gender" />
            <label for="three">死变态</label>
            <br />
            <span>Picked: {{ gender }}</span>
        </div>

        <hr>

        <div id="v-model-select" class="demo">
            <select v-model="selected">
                <option disabled value="">Please select one</option>
                <option>A</option>
                <option>B</option>
                <option>C</option>
            </select>
            <span>Selected: {{ selected }}</span>
        </div>

    </div>

    <script>
        Vue.createApp({
            data() {
                return {
                    message: '',
                    checked: false,
                    checkedNames: [],
                    gender: "死变态",
                    selected: 'B'
                }
            }
        }).mount('#v-model-textarea')
    </script>
</body>

</html>